package com.example.jpetstoreclient.domain;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@TableName(value = "collections",autoResultMap = true)
@NoArgsConstructor
public class Collection {
    private int user_id;
    private int animal_id;

    @TableId(type = IdType.AUTO)
    private int collection_id;

    @TableField(exist = false)
    private Animal animal;

    public Collection(int user_id, int animal_id) {
        this.user_id = user_id;
        this.animal_id = animal_id;
    }

    //注意参数顺序
    public Collection(int collection_id,int user_id, int animal_id ) {
        this.user_id = user_id;
        this.animal_id = animal_id;
        this.collection_id = collection_id;
    }
}
